package org.jackysoft.service;

import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.jackysoft.entity.FieldAccess;
import org.jackysoft.entity.SimpleHtmlElement;

public interface FormService {
	 /**
	 * input 元素要设置显示的类型 
	 */
	 public static final Set<String> INPUT_TYPES = new HashSet<String>(){
	
		/**
		 * 
		 */
		private static final long serialVersionUID = -79870059599191602L;

		{
			 add("text");
			 add("checkbox");
			 add("image");
			 add("file");
			 add("submit");
			 add("reset");
			 add("password");
			 add("button");		 
			 
		 }
	 };
	
	 /**
	  * <tt> 需要设置显示的htmlform元素tagname
	  * */
	 public static final Set<String> FORM_TAGNAME = new HashSet<String>(){
		 /**
		 * 
		 */
		private static final long serialVersionUID = -2930899167769167882L;

		{
			 add("input");
			 add("select");
			 add("textarea");
			 add("button");			 
		 } 
	 };
	 public String generateHtmlForm(long workflowId, byte[] data,List<SimpleHtmlElement> htmlValues);
	
	 public String generateHtmlForm(
    		 int actionId,    		
    		 int stepId,
    		 Long workflowId,
    		 String title,
    		 Map<Integer,String> nextSteps,
    		 byte[] data,
    		 List<SimpleHtmlElement> formValues,
    		 FieldAccess stepInfo,
             boolean showOnly,            
             Map<String,Object> transientVar);
     
     String extractHtmlElementsToJson(String html) throws Exception;     
}
